package com.py.credit.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import com.py.credit.entity.ApplicationEntity;
import com.py.credit.entity.BranchEntity;
import com.py.credit.entity.EasyCreditLogEntity;
import com.py.credit.entity.HireCodeEntity;
import com.py.credit.entity.HireEntity;
import com.py.credit.entity.HirePersonCodeEntity;
import com.py.credit.entity.HirePersonEntity;
import com.py.framework.core.common.Page;

public interface EasyCreditApplicationDao {

	List<ApplicationEntity> selectByConditionForPage(@Param(value = "name") String name,
			@Param(value = "userType") String userType, @Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page);

	List<ApplicationEntity> getOneInfo(@Param(value = "id") String id, @Param(value = "name") String name);

	Integer getTourPassCount();

	Integer getHirePassCount(@Param(value = "applicationType") String applicationType);

	void add(@Param(value = "entity") ApplicationEntity entity);

	void modify(@Param(value = "entity") ApplicationEntity entity);

	List<Map> getOneModel();

	void addBatch(@Param(value = "batchId") String batchId, @Param(value = "startTime") String startTime,
			@Param(value = "endTime") String endTime, @Param(value = "batchType") String batchType,
			@Param(value = "productNum") String productNum);

	void deleteBatch(@Param(value = "list") List<String> batchId);

	List<Map> selectBatchForPage(@Param(value = "date") String date, @Param(value = "page") Page page);

	String selectOneBatch();

	void addBranch(@Param(value = "entity") BranchEntity entity);

	void updateBranch(@Param(value = "entity") BranchEntity entity);

	void updateBranchInUse(@Param(value = "id") String id);

	void updateBranchInDel(@Param(value = "list") List<String> batchId);

	void updateBranchInPass(@Param(value = "isPass") String isPass, @Param(value = "id") String id);

	String checkInUse(@Param(value = "id") String id);

	List<Map> getBranchInfoForPage(@Param(value = "ztmc") String ztmc,
			@Param(value = "applicationType") String applicationType, @Param(value = "batchId") String batchId,
			@Param(value = "page") Page page);

	void addHire(@Param(value = "entity") HireEntity entity);

	HireEntity selectHire(@Param(value = "infoId") String infoId);

	List<HirePersonEntity> selectHirePerson(@Param(value = "hireId") String hireId);

	void addLog(@Param(value = "entity") EasyCreditLogEntity entity);

	List<EasyCreditLogEntity> selectLogForPage(@Param(value = "page") Page page);

	void updateHire(@Param(value = "entity") HireEntity entity);

	Map<String, Object> selectBatch(@Param(value = "id") String id);

	void updateBatchIsUser(@Param(value = "id") String id, @Param(value = "type") String type);

	List<Map<String, Object>> getTokenDetailForPage(@Param(value = "batchId") String batchId,
			@Param(value = "page") Page page);

	String getHousePhotoPath(@Param(value = "id") String id);

	void addHirePerson(@Param(value = "person") List<HirePersonEntity> person, @Param(value = "hireId") String hireId);

	String getCardPhotoPath(@Param(value = "pathName") String pathName, @Param(value = "id") String id,
			@Param(value = "type") String type);

	List<HireEntity> getHireForWeixin(@Param(value = "userId") String userId);

	Map<String, Object> getUser(@Param(value = "userName") String userName);

	List<Map<String, Object>> getHistoryByPage(@Param(value = "page")Page page,@Param(value = "id") String id);

	int getHireCountByRecordNo(@Param(value = "recordNo")String recordNo);

	Map<String,Object> selectLatest();
	
	void updateByPrimaryKeySelective(@Param(value = "id")int id, @Param(value = "path")String path);

	void upload(@Param(value = "path")String path);

	int getHireByProve(@Param(value = "belongProveNumber")String belongProveNumber,
			@Param(value = "hireStartTime")String hireStartTime,
			@Param(value = "hireEndTime")String hireEndTime);

	List<Map<String, Object>> getHistory(@Param(value = "id")String id);

	void addHireCode(@Param(value = "entity") HireCodeEntity hcEntity);

	void addHirePersonCode(@Param(value = "person") List<HirePersonCodeEntity> hpcEntityList, @Param(value = "hireId") String hireId);

	String selectHireCode(@Param(value = "type")String type,@Param(value = "infoId")String infoId);

	String selectHirePersonCode(@Param(value = "type")String type,@Param(value = "infoId")String id);

	
	void addCases(
			@Param(value = "batchId") String batchId, 
			@Param(value = "xyjcp") String xyjcp,
			@Param(value = "syztmc") String syztmc, 
			@Param(value = "xydm") String xydm, 
			@Param(value = "ztlx") String ztlx, 
			@Param(value = "tgdw") String tgdw, 
			@Param(value = "xsyhnr") String xsyhnr,
			@Param(value = "fkdw") String fkdw, 
			@Param(value = "fksj") String fksj,
			@Param(value = "officeId") long officeId, 
			@Param(value = "id") Long id);


	
	List<Map<String, String>> selectCaseForPage(@Param(value = "page")Page page,@Param(value = "type") String type, @Param(value = "xyjcp")String xyjcp);

	
	void deleteData(@Param(value="id")String id);


	
	List<Map<String, String>> selectCaseDetail(@Param(value="batchId")String batchId);

	
	
	void deleteProduct(@Param(value="id")String id);

	
	
	void updateData(
			@Param(value="batch_id")String batch_id, 
			@Param(value="xyjcp")String xyjcp,
			@Param(value="syztmc")String syztmc, 
			@Param(value="xydm")String xydm,
			@Param(value="ztlx")String ztlx, 
			@Param(value="tgdw")String tgdw,
			@Param(value="fksj")String fksj);
}
